import {
  PERMISSION_ID_ENUM,
  ANDROID_PERMISSIONS_ENUM,
  IOS_PERMISSIONS_ENUM,
} from "../enums";

/** 权限映射表 */
export const permissionMap = {
  [PERMISSION_ID_ENUM.LOCATION]: {
    android: ANDROID_PERMISSIONS_ENUM.ACCESS_FINE_LOCATION,
    ios: IOS_PERMISSIONS_ENUM.LOCATION,
  },
  [PERMISSION_ID_ENUM.CAMERA]: {
    android: ANDROID_PERMISSIONS_ENUM.CAMERA,
    ios: IOS_PERMISSIONS_ENUM.CAMERA,
  },
  [PERMISSION_ID_ENUM.PHOTO_LIBRARY]: {
    android: {
      read: ANDROID_PERMISSIONS_ENUM.READ_EXTERNAL_STORAGE,
      write: ANDROID_PERMISSIONS_ENUM.WRITE_EXTERNAL_STORAGE,
    },
    ios: IOS_PERMISSIONS_ENUM.PHOTO_LIBRARY,
  },
  [PERMISSION_ID_ENUM.PUSH]: {
    android: ANDROID_PERMISSIONS_ENUM.PUSH,
    ios: IOS_PERMISSIONS_ENUM.PUSH,
  },
  [PERMISSION_ID_ENUM.CALL_PHONE]: {
    android: ANDROID_PERMISSIONS_ENUM.CALL_PHONE,
    ios: IOS_PERMISSIONS_ENUM.CALL_PHONE,
  },
  [PERMISSION_ID_ENUM.CONTACT]: {
    android: {
      read: ANDROID_PERMISSIONS_ENUM.READ_CONTACTS,
      write: ANDROID_PERMISSIONS_ENUM.WRITE_CONTACTS,
    },
    ios: IOS_PERMISSIONS_ENUM.CONTACT,
  },
  [PERMISSION_ID_ENUM.RECORD]: {
    android: ANDROID_PERMISSIONS_ENUM.RECORD_AUDIO,
    ios: IOS_PERMISSIONS_ENUM.RECORD,
  },
  [PERMISSION_ID_ENUM.CALENDAR]: {
    android: {
      read: ANDROID_PERMISSIONS_ENUM.READ_CALENDAR,
      write: ANDROID_PERMISSIONS_ENUM.WRITE_CALENDAR,
    },
    ios: IOS_PERMISSIONS_ENUM.CALENDAR,
  },
  [PERMISSION_ID_ENUM.MEMO]: {
    android: ANDROID_PERMISSIONS_ENUM.WRITE_EXTERNAL_STORAGE,
    ios: IOS_PERMISSIONS_ENUM.MEMO,
  },
  [PERMISSION_ID_ENUM.GPS]: {
    android: ANDROID_PERMISSIONS_ENUM.GPS,
    ios: IOS_PERMISSIONS_ENUM.GPS,
  },
};
